const tokenKey = 'medicine_t';
const userStatusKey = 'medicine_us';

// token
const storage = {
  setToken(token) {
    try{
      wx.setStorageSync(tokenKey,token)
    } catch {
      console.log('插入本地缓存错误');
    }
  },
  
  getToken() {
    try{
      return wx.getStorageSync(tokenKey)
    } catch {
      console.log('读取本地缓存错误');
    }
  },
  // userStatus
  setUserStatus(userStatus) {
    try{
      wx.setStorageSync(userStatusKey,userStatus)
    } catch {
      console.log('插入本地缓存错误');
    }
  },
  
  getUserStatus() {
    try{
      return wx.getStorageSync(userStatusKey)
    } catch {
      console.log('读取本地缓存错误');
    }
  }
}

module.exports = storage